<?php

// $Id$


require_once(TANGRA_MAIN_DIR.'form/fields/text/form_field_text_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/password/form_field_password_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/checkbox/form_field_checkbox_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/guardable_form_view.class.php');


class User_Form_View extends Guardable_Form_View {
	function __construct(Form &$form) {
		parent::__construct($form);

		$f_username = $form->get_field('username');
		$f_username_view = new Form_Field_Text_View($form->get_name().'_'.$f_username->get_name(), $f_username);
		$this->add_field_view('username', $f_username_view);

		$f_password = $form->get_field('password');
		$f_password_view = new Form_Field_Password_View($form->get_name().'_'.$f_password->get_name(), $f_password);
		$this->add_field_view('password', $f_password_view);

		$f_password2 = $form->get_field('password2');
		$f_password2_view = new Form_Field_Password_View($form->get_name().'_'.$f_password2->get_name(), $f_password2);
		$this->add_field_view('password2', $f_password2_view);

		$f_disabled = $form->get_field('disabled');
		$f_disabled_view = new Form_Field_Checkbox_View($form->get_name().'_'.$f_disabled->get_name(), $f_disabled);
		$this->add_field_view('disabled', $f_disabled_view);
	}
}